package entity;
/*
    date：
    topic：
    
*/

public class pageBean {
    private int everyPage; // 每页显示记录数
    private int totalCount; // 总记录数
    private int totalPage; // 总页数
    private int currentPage; //当前页
    private int beginIndex;			//查询起始点
    public pageBean(int everyPage, int totalCount , int currentPage) {
        super();
        this.everyPage = everyPage;
        this.totalCount = totalCount;
        this.currentPage = currentPage;
        if(totalCount != 0 &&totalCount % everyPage == 0) {
            totalPage = totalCount / everyPage;
        } else {
            totalPage = totalCount / everyPage + 1;
        }
    }
    public int getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(int currentPage) {
        if(currentPage<1)currentPage=1;
        this.currentPage = currentPage;

    }
    public int getEveryPage() {
        return everyPage;
    }
    public void setEveryPage(int everyPage) {
        this.everyPage = everyPage;
    }
    public int getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }
    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }
    public int getBeginIndex() {
        setBeginIndex();
        return beginIndex;
    }
    public void setBeginIndex() {
        this.beginIndex =(currentPage - 1) * everyPage;
    }

}
